package com.gears_software.sxdc.dccx.data.finder;

import com.gears_software.sxdc.dccx.data.finder.util.GearsAuthInterceptor;
import com.gears_software.sxdc.dccx.data.model.ResultModel;
import com.gears_software.sxdc.dccx.data.model.VehicleModel;
import com.gears_software.sxdc.dccx.data.model.request.RAddVehicleModel;
import com.gears_software.sxdc.dccx.data.model.request.RXingShiZhengModel;

import org.androidannotations.rest.spring.annotations.Body;
import org.androidannotations.rest.spring.annotations.Get;
import org.androidannotations.rest.spring.annotations.Path;
import org.androidannotations.rest.spring.annotations.Post;
import org.androidannotations.rest.spring.annotations.Put;
import org.androidannotations.rest.spring.annotations.Rest;
import org.androidannotations.rest.spring.api.RestClientErrorHandling;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.util.List;

/**
 * Created by chezhenzhen on 2017/7/29.
 * 车辆相关接口
 */

@Rest(rootUrl = RequestUrl.ROOT,
        interceptors = GearsAuthInterceptor.class,
        converters = {MappingJackson2HttpMessageConverter.class})
public interface IVehicleFinder extends RestClientErrorHandling {

    /**
     * 添加车辆信息
     *
     * @param model
     **/
    @Post("/api/vehicle/add")
    ResultModel<VehicleModel> add(@Body RAddVehicleModel model);

    /**
     * 获取车辆列表
     **/
    @Get("/api/vehicle/my")
    ResultModel<List<VehicleModel>> getVehicleList();

    /**
     * 更新车辆信息
     *
     * @param id
     **/

    @Post("/api/vehicle/update?id={id}")
    ResultModel<String> updateVehicle(@Body RAddVehicleModel vehicleModel, @Path String id);

    /**
     * 删除辆信息
     *
     * @param id
     **/
    @Get("/api/vehicle/delete?id={id}")
    ResultModel<String> deleteVehicle(@Path String id);

    /**
     * 认证信息提交
     */
    @Put("/api/vehicle/cert?id={id}")
    ResultModel<String> xingShiZhengAuthentication(@Path String id, @Body RXingShiZhengModel model);

    /**
     * 获取车辆信息
     */
    @Get("/api/vehicle/get?id={id}")
    ResultModel<VehicleModel> getVehicleInfo(@Path String id);

    /**
     * 设置默认车辆
     */
    @Put("/api/vehicle/default?id={id}")
    ResultModel<String> setVehicleDefault(@Path String id);

}
